#ifndef __BMP_h_
#define __BMP_h_

#ifndef _DATA_TYPE
#define _DATA_TYPE
typedef unsigned long DWORD;
typedef unsigned short WORD;
typedef unsigned char BYTE;
typedef long LONG;
#endif

typedef struct __BMP_FILE_HEADER
{
    DWORD bfSize;
    WORD bfReserved1;
    WORD bfReserved2;
    DWORD bfOffset;
} BMP_FILEHEADER;

typedef struct __BMP_INFO_HEADER
{
    DWORD biSize;//size of BMP_INFOHEADER
    DWORD biWidth;//宽
    LONG biHeight;//高(正数表示从下到上,负数表示从上到下)
    WORD biPlanes;//平面数,恒定为1
    WORD biBitCount;//位数
    DWORD biComperession;//压缩方式,0表示不压缩
    DWORD biSizeImage;//图像大小,不压缩设为0
    DWORD biXPelsPerMeter;//横向分辨率
    DWORD biYPelsPerMeter;//纵向分辨率
    DWORD biClrUsed;//使用颜色数
    DWORD biClrImportant;//重要颜色数
} BMP_INFOHEADER;

typedef struct __RGBQUAD
{
    BYTE rgbBlue;
    BYTE rgbGreen;
    BYTE rgbRed;
    BYTE rgbAlpha;
} BMP_RGBQUAD;

typedef struct __BMP4bit_CACHE
{
    BMP_INFOHEADER info;
    BMP_RGBQUAD quad[16];
    void *data;
} BMP4bit_CACHE;

#endif
